// import * as dd from "dingtalk-jsapi"; // 此方式为整体加载，也可按需进行加载

export const setTitle = (title) => {
  if (typeof title !== "string" || !title.trim()) {
    return Promise.reject(new Error("Invalid title"));
  }
  document.title = title;
  // try {
  //   return new Promise((resolve, reject) => {
  //     dd.setNavigationTitle({
  //       title: title.trim(),
  //       success: resolve,
  //       fail: reject,
  //       complete: () => {},
  //     });
  //   });
  // } catch (e) {
  //   return resolve();
  // }
};
